package com.pureut.system.api;


import com.pureut.common.core.constant.ServiceNameConstants;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.system.api.factory.RemoteQuilityFallbackFactory;
import com.pureut.system.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author: CM
 * @date: 2023/2/22    16:17
 */
@FeignClient(contextId = "qualityFeginService", value = ServiceNameConstants.PUREUT_QUALITY, fallbackFactory = RemoteQuilityFallbackFactory.class)
public interface QualityFeginService {

    /**
     * 检验单据新增
     */
    @PostMapping("/quality-inspection-document/add")
    public AjaxResult add(@Validated @RequestBody QualityInspectionDocumentVo qualityInspectionDocumentVo) throws Exception;

    /**
     * 品质批次送检新增接口
     * @param qualityTemporaryVo
     * @return
     */
    @PostMapping("/quality-temporary/materialAdd")
    public AjaxResult materialAdd(@RequestBody QualityTemporaryVo qualityTemporaryVo);

    /**
     * 小卷打包数据新增至冻结页面数据（fegin调用）
     */
    @PostMapping("/quality-production-freeze/smallRollAdd")
    public boolean smallRollAdd(@RequestBody QualityProductionFreezeVo qualityProductionFreezeVo);


    /**
     * 检验是否配置方案
     */
    @PostMapping("/quality-scheme-configuration/check")
    public boolean check(@RequestBody QualitySchemeConfigurationVo qualitySchemeConfigurationVo);

    /**
     * 根据供应商加物料编码/加工商加物料编码获取物料免检状态（feign调用）
     */
    @PostMapping("/quality-inspection-management/getInspectionMark")
    public AjaxResult getInspectionMark(@RequestBody InspectionMarkVo inspectionMarkVo);

    /**
     * 删除品质检验单Feign
     * @param relevanceDoc
     * @return
     */
    @DeleteMapping("/quality-inspection-document/{relevanceDoc}")
    public AjaxResult removeDoc(@PathVariable("relevanceDoc") String relevanceDoc);

    /**
     * 查询品检信息（feign调用 追溯管理页面使用）
     */
    @GetMapping("/quality-temporary/getQualityTemporaryList")
    public AjaxResult getQualityTemporaryList(@RequestParam("wsiMaterialNumber") String wsiMaterialNumber);

    /**
     * 查询巡检信息（feign调用 追溯管理页面使用）
     */
    @GetMapping("/quality-temporary/getPatrolTemporaryList")
    public AjaxResult getPatrolTemporaryList(@RequestParam("wsiMaterialNumber") String wsiMaterialNumber);

    /**
     * 生产看板-班组近7天良品率(feign)
     */
    @GetMapping("/quality-inspection-document/getYield")
    public AjaxResult getYield(@RequestParam("lineCode") String lineCode);

    /**
     * 生产看板-本月品质不良分布
     */
    @GetMapping("/quality-inspection-document/getBadMonth")
    public AjaxResult getBadMonth(@RequestParam("lineCode") String lineCode);

    /**
     * 检验单据新增(脱脂送检使用)
     */
    @PostMapping("/quality-inspection-document/addDegreas")
    public boolean addDegreas(@RequestBody QualityInspectionDocumentVo qualityInspectionDocumentVo);

    /**
     * 根据批次号查询品质检验单(fegin调用)
     */
    @GetMapping("/quality-inspection-document/getDocumentByBatchNumber")
    public AjaxResult getDocumentByBatchNumber(@RequestParam("batchNumber") String batchNumber,@RequestParam("degreasDocumentNumber") String degreasDocumentNumber);

    /**
     * 检验单据新增(仓库模块使用)
     */
    @PostMapping("/quality-inspection-document/addWares")
    public boolean addWares(@RequestBody QualityInspectionDocumentVo qualityInspectionDocumentVo);

    /**
     * 修改品质检验单数据状态（fegin调用）
     */
    @PostMapping("/quality-inspection-document/updateQualityInspectionDocument")
    public AjaxResult updateQualityInspectionDocument(@RequestBody UpdateQualityStatusVo updateQualityStatusVo);
}
